from django.db import models

# Create your models here.
# 用户表
class user(models.Model):
    uuid = models.CharField(verbose_name="用户uuid", max_length=225, db_column="uuid")
    openid = models.CharField(
        verbose_name="服务器id", max_length=255, db_column="openid", default=""
    )
    phone = models.CharField(
        verbose_name="手机号", max_length=20, db_column="phone", default=""
    )
    name = models.CharField(
        verbose_name="姓名", max_length=32, db_column="name", default=""
    )
    sex = models.CharField(
        verbose_name="性别", max_length=32, db_column="sex", default=""
    )
    nation = models.CharField(
        verbose_name="民族", max_length=200, db_column="nation", default=""
    )
    birth = models.CharField(
        verbose_name="出生日期", max_length=32, db_column="birth", default=""
    )
    address = models.CharField(
        verbose_name="住址", max_length=200, db_column="address", default=""
    )
    idCard = models.CharField(verbose_name="身份证号", max_length=32, db_column="id_card")
    isValidate = models.IntegerField(
        verbose_name="是否认证 0：未认证 1:认证", db_column="is_validate", default=0
    )


# 检测任务表
class check_task(models.Model):
    uuid = models.CharField(verbose_name="检测任务uuid", max_length=225, db_column="uuid")
    bottle_id = models.CharField(
        verbose_name="瓶身id", max_length=225, db_column="bottle_id"
    )
    video_url = models.CharField(
        verbose_name="视频url", max_length=225, db_column="video_url"
    )
    upload_time = models.CharField(
        verbose_name="创建时间", max_length=225, db_column="upload_time"
    )
    video_state = models.IntegerField(
        verbose_name="视频审核状态 -1: 审核未通过 0：审核中 1: 审核通过",
        db_column="video_state",
        default=0,
    )
    check_result_state = models.IntegerField(
        verbose_name="0：检测中 1: 检测完成 ", db_column="check_result_state", default=0
    )
    user_uuid = models.CharField(
        verbose_name="用户uuid", max_length=50, db_column="user_uuid", default=""
    )
    check_report_url = models.CharField(
        verbose_name="检测结果pdf路径",
        max_length=50,
        db_column="check_report_url",
        default="",
    )


# 系统管理后台用户表
class admin_user(models.Model):
    uuid = models.CharField(verbose_name="用户uuid", max_length=225, db_column="uuid")
    user_name = models.CharField(
        verbose_name="用户名", max_length=32, db_column="user_name", default=""
    )
    password = models.CharField(
        verbose_name="密码", max_length=32, db_column="password", default=""
    )
    real_name = models.CharField(
        verbose_name="真实姓名", max_length=22, db_column="real_name", default=""
    )
    email = models.CharField(
        verbose_name="邮箱", max_length=32, db_column="email", default=""
    )
    phone = models.CharField(
        verbose_name="手机号", max_length=20, db_column="phone", default=""
    )
    user_type = models.CharField(
        verbose_name="用户类型", max_length=2, db_column="user_type", default="01"
    )
    create_by = models.CharField(
        verbose_name="创建人", max_length=20, db_column="create_by", default=""
    )
    create_time = models.CharField(
        verbose_name="创建时间", max_length=20, db_column="create_time", default=""
    )
    update_by = models.CharField(
        verbose_name="更新人", max_length=20, db_column="update_by", default=""
    )
    updat_time = models.CharField(
        verbose_name="更新时间", max_length=20, db_column="updat_time", default=""
    )
    status = models.CharField(
        verbose_name="状态", max_length=1, db_column="status", default=""
    )
    del_flag = models.CharField(
        verbose_name="删除状态", max_length=1, db_column="del_flag", default=""
    )
    avatar = models.CharField(
        verbose_name="职务", max_length=50, db_column="avatar", default=""
    )
